# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=spdk
pkgver=24.09
pkgrel=0
pkgdesc="Storage Performance Development Kit"
url="https://spdk.io/"
# only supports 64bit
# loongarch64 no dpdk
arch="aarch64 ppc64le riscv64 x86_64"
license="BSD-3-Clause"
makedepends="
	bash
	bsd-compat-headers
	coreutils
	cunit-dev
	dpdk-dev
	fuse3-dev
	isa-l-dev
	libaio-dev
	linux-headers
	ncurses-dev
	openssl-dev>3
	patchelf
	python3
	py3-pip
	py3-setuptools
	util-linux-dev
	"
subpackages="$pkgname-static $pkgname-dev $pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/spdk/spdk/archive/v$pkgver.tar.gz
	isal.patch
	remove-stupid.patch
	"
# tests hang on ppc64le and riscv64
case "$CARCH" in
	aarch64|x86_64) makedepends="$makedepends isa-l_crypto-dev"
	;;
	ppc64le|riscv64) options="!check"
	;;
esac

build() {
	# this is not a GNU autoconf script
	./configure \
		--prefix=/usr \
		--with-shared \
		--with-dpdk \
		--with-system-isal \
		--without-crypto
	make
}

check() {
	./test/unit/unittest.sh
}

package() {
	DESTDIR="$pkgdir" make install
}

sha512sums="
f9a51821cf92ba40d656fc3e965fb8d9d35b8fe7c5149334998778b8272e37155e83c7704895a85f61a47b514eff8d52fb86dc63e51da784c2e87509529caaae  spdk-24.09.tar.gz
33963faf4c39e937593af192c55dc3b7be8520bf870c75fdcff870fe6f932b083773d320ff2ce8a381ef53953cfe03b1e490584c51d5980627c109718b4a9ca9  isal.patch
087f189776699685791900014beb0ab5d8fc369133b205368100aea4e6ea4d1c85061bb1719bffa21b6a949639180cb8966e85f553efc85eaeb608a7940ffc3b  remove-stupid.patch
"
